import { Ref, shallowRef } from "vue";
import ActionManager from "../game/actionmanager";
import { Battle } from "../game/Battle";
import { BattleData } from "../extra/battleData";
const battle = shallowRef() as Ref<Battle>
const actionManager = shallowRef() as Ref<ActionManager>
export function useBattle(data?: BattleData,acitons?:any[]) {
    if (data) {
        battle.value = new Battle(data.game_id, data)
        actionManager.value = new ActionManager(battle.value)
    }
    return battle
}

export function useActionManager() {
    return actionManager
}